#!/bin/sh

#################the project init job#################
export BasePath="/cygdrive/e/project/SinaTay_Project"
export SSDIR=\\\\10.11.5.25\\VssSrcXinTai
export VSS_USR="dailybuild,sinosoft"

cd ${BasePath}

if !(ant -k daily_emergent_init)
then 
echo "************************************************"
echo "sorry the daily_emergent_init job failed "
echo "************************************************"
exit 
fi

ss delete $/A_dailybuild/emergent/function     -I- -Y${VSS_USR}
ss purge  $/A_dailybuild/emergent/function     -I- -Y${VSS_USR}
ss delete $/A_dailybuild/emergent/menu         -I- -Y${VSS_USR}
ss purge  $/A_dailybuild/emergent/menu         -I- -Y${VSS_USR}
ss delete $/A_dailybuild/emergent/modify_base  -I- -Y${VSS_USR}
ss purge  $/A_dailybuild/emergent/modify_base  -I- -Y${VSS_USR}
ss delete $/A_dailybuild/emergent/modify_data  -I- -Y${VSS_USR}
ss purge  $/A_dailybuild/emergent/modify_data  -I- -Y${VSS_USR}
ss delete $/A_dailybuild/emergent/struct_base  -I- -Y${VSS_USR}
ss purge  $/A_dailybuild/emergent/struct_base  -I- -Y${VSS_USR}
ss delete $/A_dailybuild/emergent/struct_data  -I- -Y${VSS_USR}
ss purge  $/A_dailybuild/emergent/struct_data  -I- -Y${VSS_USR}
ss delete $/A_dailybuild/emergent/xml          -I- -Y${VSS_USR}
ss purge  $/A_dailybuild/emergent/xml          -I- -Y${VSS_USR}
ss create $/A_dailybuild/emergent/modify_base  -I- -Y${VSS_USR}
ss create $/A_dailybuild/emergent/modify_data  -I- -Y${VSS_USR}
ss create $/A_dailybuild/emergent/struct_base  -I- -Y${VSS_USR}
ss create $/A_dailybuild/emergent/struct_data  -I- -Y${VSS_USR}
ss create $/A_dailybuild/emergent/xml          -I- -Y${VSS_USR}
ss create $/A_dailybuild/emergent/function     -I- -Y${VSS_USR}
ss create $/A_dailybuild/emergent/menu         -I- -Y${VSS_USR}

##################analyse xml and deal with ui ###############
sh ${BasePath}/lis_sh/emergent_ui.yz
#
#################analyse xml and deal with java ###############
sh ${BasePath}/lis_sh/emergent_java.yz

#################copy two xml files from lis_sh/ to A_dailybuild/common/xml ###############
cd ${BasePath}
cp lis_sh/build_emergent_ui.xml A_dailybuild/emergent/xml
cp lis_sh/build_emergent_java.xml A_dailybuild/emergent/xml

#################deal with email and the result#################
cd ${BasePath}

ant -k daily_cleanup_emergent   #mainly deal with the backup things	

ant -k dailybuild_add_backup_files_to_vss_emergent

date
